//
//  LGAdviceRecordTitleHeader.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/10/8.
//

#import "LGAdviceRecordTitleHeader.h"

@interface LGAdviceRecordTitleHeader()

/**   */
@property (nonatomic , strong)UIImageView *iconView;
/**   */
@property (nonatomic , strong)UILabel *titleLabel;

@end

@implementation LGAdviceRecordTitleHeader

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}

-(void)setTitle:(NSString *)title{
    _title = title;
    self.titleLabel.text = title;
//    self.iconView.image = [UIImage imageNamed:[NSString stringWithFormat:@"医嘱记录-%@",title]];
}

#pragma mark
#pragma mark ====> 创建控件
-(void)createSubView{
    [self addSubview:self.iconView];
    [self addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconView);
        make.centerY.equalTo(self.iconView);
    }];
}

-(UIImageView *)iconView{
    if(!_iconView){
        _iconView = [[UIImageView alloc]initWithFrame:CGRectMake(viewPix(16), viewPix(10), viewPix(16), viewPix(16))];
    }
    return _iconView;
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(14, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _titleLabel;
}


@end
